<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>angular4</title>
  <script  src="/jquery-1.11.1.js"></script>
</head>
<body>
  <form action="/upload" method="post" enctype="multipart/form-data"
  target="ifa" id="form1">
  <input type="file"  id="file" name="upfile" multiple>
  <button>sub</button>
  </form>
<iframe name="ifa"></iframe>
<button onclick="upload()">file</button>
<script>
function upload(){
  var f=new FormData();
  var file=document.querySelector('#file').files;
  for(var i=0;i<file.length;i++){
      f.append('upfile',file[i]);
  }
    $.ajax({
        url:'/upload',type:'post',processData: false,contentType: false,
        data:f,success:function(data){
          console.log(data);
        }
    })
}
</script>
</body>
</html>
